package com.lottoad.android.activity.ad.adapter;

import java.util.ArrayList;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;

import com.lottoad.android.R;

public class LottoAdJobListAdapter extends BaseAdapter {
	
	private ArrayList<String> mJobListArray;
	
	private Context mContext;
	
	public LottoAdJobListAdapter(Context con, ArrayList<String> jobListArray) {
		mJobListArray = jobListArray;
		mContext = con;
	}
	
	public LottoAdJobListAdapter(Context con) {
		mContext = con;
		mJobListArray = new ArrayList<String>();
	}
	
	public void setJobNameListArray(ArrayList<String> jobList) {
		mJobListArray = jobList;
	}

	@Override
	public int getCount() {
		return mJobListArray.size();
	}

	@Override
	public Object getItem(int position) {
		return mJobListArray.get(position);
	}

	@Override
	public long getItemId(int position) {
		return position;
	}

	@Override
	public View getView(int position, View view, ViewGroup parent) {
		LayoutInflater inflater = (LayoutInflater) mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
		if(view == null) {
			view = inflater.inflate(R.layout.lottoad_job_list_column, null);
		}
		
		TextView jobName = (TextView) view.findViewById(R.id.tv_job_list_content);
		
		jobName.setText(mJobListArray.get(position));
		
		return view;
	}

}
